﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="为gridview每行添加超链接及绑定ddl.aspx.cs" Inherits="FileUpload.为gridview每行添加超链接" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            OnRowDataBound="RowDataBind" DataKeyNames="id" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="班级ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="className" HeaderText="班级名称" 
                    SortExpression="className" />
                <asp:BoundField DataField="classDesc" HeaderText="班级描述" 
                    SortExpression="classDesc" />
                <asp:BoundField DataField="isDel" HeaderText="是否删除" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:TemplateField HeaderText="超链接">
                    <ItemTemplate>
                        <asp:Label ID="lbLink" runat="server" Text="Label"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                    <asp:DropDownList ID="ddl" runat="server">
                    </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:school1ConnectionString %>" 
            SelectCommand="SELECT * FROM [Class1]"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
